package Day3;

import java.util.PriorityQueue;
import java.util.Scanner;

public class Day03_03 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();

        PriorityQueue<Long> heap = new PriorityQueue<Long>((a, b) -> {
            return (int)(b - a);
        });

        long sum = 0;
        while(in.hasNextLong()) {
            long temp = in.nextLong();
            sum += temp;
            if(temp % 2 == 0) {
                heap.add(temp);
            }
        }

        while(!heap.isEmpty() && k > 0) {
            long temp = heap.poll() / 2;
            sum -= temp;
            if(temp % 2 == 0) {
                heap.add(temp);
            }
            k--;
        }
        System.out.print(sum);
    }
}
//https://ac.nowcoder.com/acm/problem/213140
